﻿@model HelloMinasan.Web.Song.ViewModels.NotesModel
<div class="noteList">
    @foreach (var item in @Model.UserNotes)
    {
        <div class="noteItem" id="noteItem-@item.Id">
            <div class="createdDateTime">
                @item.CreatedDate
                @if (Model.isOwner)
                {
                    <div class="noteControl">
                        <img src="~/Content/Images/delete.png" width="20" onclick="deleteNote('@Model.UserAccount',@Model.PagingControl.CurrentPageNumber, @item.Id)" /></div>
                }
            </div>
            <div class="noteItemComment titleNewFont fontsize16px">@item.Comments</div>
        </div>
    }
    <div align="left" style="margin-top: 10px;">
        @if (@Model.PagingControl.PreviousPageNumber > 0)
        {
            <a onclick="gotoNotePage('@Model.UserAccount', 1)" class="buttonClass">First</a>
            <a onclick="gotoNotePage('@Model.UserAccount', @Model.PagingControl.PreviousPageNumber)" class="buttonClass">Back</a>
        }
        <select onchange="jumpToNotePage(this, '@Model.UserAccount')">
            @for (int i = 1; i <= Model.TotalPageCount; i++)
            {
                if (i != Model.PagingControl.CurrentPageNumber)
                { <option value="@i">@i</option> }
                else
                { <option value="@i" selected>@i</option> }
            }
        </select>
        @if (@Model.PagingControl.NextPageNumber <= Model.TotalPageCount)
        {
            <a onclick="gotoNotePage('@Model.UserAccount', @Model.PagingControl.NextPageNumber)" class="buttonClass">Next</a>
            <a onclick="gotoNotePage('@Model.UserAccount', @Model.TotalPageCount)" class="buttonClass">Last</a>
        }
    </div>
</div>
